package com.frogs.ucenter.v1.request;

import javax.servlet.http.HttpServletRequest;

import com.frogs.framework.util.StringUtil;
import com.frogs.framework.web.HttpRequestInfo;
import com.frogs.system.util.ApiUrlParamEnum;
import com.frogs.system.util.ApplicablePlatformEnum;
import com.frogs.system.util.GoodsEvaluateEnum;
import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.exception.RequestIllegalException;

public class InsuranceCodeAddRequest extends Request {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5405495720322761086L;

	/**
	 * 账号ID
	 */
	private int userId;
	
	/**
	 * 订单编码
	 */
	private String orderSn;
	
	/**
	 * 保险信息id
	 */
	private int insuranceId;
	
	public InsuranceCodeAddRequest() {
		
	}
	
	@Override
	public void parse(HttpServletRequest request) {
		
		HttpRequestInfo requestInfo = new HttpRequestInfo(request);
		this.userId = requestInfo.getIntParameter(ApiUrlParamEnum.userId.getParamName(), 0);
		this.orderSn = requestInfo.getParameter(ApiUrlParamEnum.orderSn.getParamName(), "-");
		this.insuranceId = requestInfo.getIntParameter(ApiUrlParamEnum.insuranceId.getParamName(), 0);
		
		if (insuranceId < 1) {
			throw new RequestIllegalException("error insuranceId:" + insuranceId);
		}
		
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public String getOrderSn() {
		return orderSn;
	}

	public void setOrderSn(String orderSn) {
		this.orderSn = orderSn;
	}

	public int getInsuranceId() {
		return insuranceId;
	}

	public void setInsuranceId(int insuranceId) {
		this.insuranceId = insuranceId;
	}

	
	
}
